home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 256_01 / lovlay.a < prev    next >
Encoding:
Text File  |  1988-01-06  |  2.1 KB  |  55 lines

  1. ;---------------------------------------------------------------------
  2. ;    ASM88 FILE:     LOVLAY.A     Load Overlay
  3. ;    ----------
  4. ;    WRITTEN:        25/10/87
  5. ;    -------
  6. ;    PURPOSE:        This is one of a series of files which take
  7. ;    -------         advantage of INT 21H functions under MS-DOS.
  8. ;                    In each case the error situation is marked by
  9. ;                    the carry flag being set.   We use the De Smet
  10. ;                    external variable '_carryf' to see whether the
  11. ;                    carry is set on return from the function.
  12. ;                    If so, the error code can be used to obtain
  13. ;                    information about the specific error.
  14. ;
  15. ;    USAGE:          int LOVLAY(name, parm_blk, &_carryf)
  16. ;    -----           char *name, /* pointer to pathname */
  17. ;                         *parm_blk; /* pointer to parameter block
  18. ;                                       in ES */
  19. ;                    char *_carryf;
  20. ;
  21. ;    DEPENDENCIES:           De Smet C V 2.44+
  22. ;    ------------
  23. ;    Copyright 1987 - Cogar Computer Services Pty. Ltd
  24. ;---------------------------------------------------------------------
  25.  
  26. CSEG
  27. PUBLIC LOVLAY_
  28.  
  29. LOVLAY_:
  30.     push    bp    ; normal De Smet C start
  31.     mov    bp,sp    ; point to the stack
  32.     mov    ax,ds    ; and make ES common with DS
  33.     mov    es,ax
  34. ;----------------------------------------------------------------------
  35. ;  The unique programme follows.
  36. ;----------------------------------------------------------------------
  37.     mov    dx,[bp+4]    ; the pathname address
  38.     mov    bx,[bp+6]    ; the parameter block address
  39.     mov    ah,4bh    ; the Function No.
  40.     mov    al,3
  41.     int    21h
  42.     jc    LOVLAY_ERROR
  43.     xor    ax,ax    ; prepare for normal return
  44.     jmp    LOVLAY_QUIT
  45. LOVLAY_ERROR:
  46.     mov    si,[bp+8]    ; get address of '_carryf' variable
  47.     mov    byte [si],1    ; return with _carryf = 1
  48. ;----------------------------------------------------------------------
  49. ;  Normal programme termination.
  50. ;----------------------------------------------------------------------
  51. LOVLAY_QUIT:
  52.     pop    bp    ; restore starting conditions
  53.     ret
  54. ;----------------------------------------------------------------------
  55.